use futures::executor::block_on;
use sea_orm::{Database, DbErr};

#[tokio::main]
async fn main() -> Result<(), DbErr>{
    let db = establish_connection().await;

    let post = post::ActiveModel {
        title: Set(String::from("我是title")),
        text: Set(String::from("我是text")),
        ..Default::default()
    };

    let post: post::Model = post.insert(&db).await?;

    println!("ID: {}, title: {}", post.id, post.title);

    Ok(())
}